package com.milotnt.controller;

import com.milotnt.service.StatsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/api/stats")
public class StatsController {

    private final StatsService statsService;

    public StatsController(StatsService statsService) {
        this.statsService = statsService;
    }

    @GetMapping("/monthly-members")
    public Map<String, Object> getMonthlyMemberStats() {
        return statsService.getMonthlyMemberStats();
    }

    @GetMapping("/course-sales")
    public Map<String, Object> getCourseEnrollmentStats() {
        return statsService.getCourseEnrollmentStats();
    }
}